package tests.html_generators;

import java.io.*;
import java.util.NoSuchElementException;
import java.util.Scanner;

public class ListGenerator {

    public static void main(String[] args) {
        if (args.length != 3) {
            System.err.println("usage : <input> <output> <element_type>");
            return;
        }
        try {
            try (Scanner scanner = new Scanner(new File(args[0]));
                    PrintWriter printWriter = new PrintWriter(new File(args[1]))) {
                while (true) {
                    printWriter.println(
                            String.format("<%s>%s</%s>",
                                    args[2], scanner.next(), args[2]));
                }
            }
        } catch (NoSuchElementException noSuchElementException) {
            System.out.println("reading completed");
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}